package cn.wolfcode.shop.cloud.mapper;

import cn.wolfcode.shop.cloud.domain.SecKillOrder;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * Created by Administrator on 2020/4/24 0024.
 */
@Mapper
public interface SeckillOrderMapper {

    @Select("select * from t_seckill_order where user_id = #{userId} AND seckill_id = #{seckillId}")
    SecKillOrder queryByUserIdAndSeckillId(@Param("userId") Long userId, @Param("seckillId") Long seckillId);

    @Insert("insert into t_seckill_order (user_id,seckill_id,order_no) values (#{userId},#{seckillId},#{orderNo})")
    void createSecillOrder(@Param("userId") Long userId,@Param("seckillId") Long seckillId,@Param("orderNo") String orderNo);
}
